package com.tledu.production.controller.system;

import com.tledu.production.core.result.AjaxResult;
import com.tledu.production.model.system.SysResGroup;
import com.tledu.production.service.system.ISysResGroupService;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author Antg
 * @date 2021/8/18  15:53
 */
@RestController
@AllArgsConstructor
@RequestMapping("/system/resGroup")
public class SysResGroupController {
    private final ISysResGroupService sysResGroupService;

    @GetMapping("/list")
    public AjaxResult<List<SysResGroup>> findAll() {
        List<SysResGroup> list = sysResGroupService.findAll();
        return new AjaxResult<>(list);
    }

    @GetMapping("/findById")
    public AjaxResult<SysResGroup> findById(Integer id) {
        SysResGroup sysResGroup = sysResGroupService.findById(id);
        return new AjaxResult<>(sysResGroup);
    }
}
